package org.wdcode.news.po;

import java.io.Serializable;

import org.wdcode.back.po.BaseBackCreateDateEntityBean;
import org.wdcode.common.tools.Conversion;
import org.wdcode.common.util.CommonUtil;
import org.wdcode.back.helper.UserHelper;
import org.wdcode.back.po.User;

/**
 * 栏目实体
 * @author WD
 * @since JDK6
 * @version 1.0 2010-05-12
 */
public final class Category extends BaseBackCreateDateEntityBean implements Serializable {
	// 序列化ID
	private static final long	serialVersionUID	= -7705356910929929129L;

	// 创建者ID
	private Integer				userId;

	// 创建者实体
	private User				user;

	/**
	 * 获得创建者ID
	 * @return 创建者ID
	 */
	public Integer getUserId() {
		return userId;
	}

	/**
	 * 设置创建者ID
	 * @param userId 创建者ID
	 */
	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	/**
	 * 获得创建者
	 * @return 创建者
	 */
	public User getUser() {
		return CommonUtil.isEmpty(user) ? UserHelper.getHelper().get(Conversion.toInt(userId)) : user;
	}
}
